package com.sxt.controller;

import com.sxt.common.validator.ValidatorUtil;
import com.sxt.domain.BusReturn;
import com.sxt.query.BusReturnQuery;
import com.sxt.service.BusReturnService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: 还车记录控制类
 */
@RestController
@RequestMapping("return")
public class BusReturnController {
    @Autowired
    private BusReturnService busReturnService;

    /**
     * 新增还车记录
     *
     * @param busReturn
     * @return
     */
    @RequestMapping("add.do")
    public Object add(BusReturn busReturn) {
        ValidatorUtil.validator(busReturn);
        return busReturnService.add(busReturn);
    }

    /**
     * 还车记录的分页查询
     *
     * @param query
     * @return
     */
    @RequestMapping("page.do")
    public Object page(BusReturnQuery query) {
        return busReturnService.queryPage(query);
    }

}
